#!/bin/bash
echo "<html>"
# That line makes the magic with second workaround
[ "$p_close" == "True" ] && echo '<scripttool close /></html>' && exit

echo "<scripttool window=maximized />"
echo "<h1>That is a Maximized Window!</h1>"

echo "<a href=javascript:close('window'); >Click here to close [is not going to work...]</a>"
echo "<br/>Workaround on close: config_tool pid: $CT_PID <br/>"
echo "<a href=file:///tmp/tmp.$$.sh> Click here to close with workaround... </a>"
echo "<br/> Another workaround -- that one is prettyer.. <br/>"
echo "<a href=$0?close=True> Click here to close with handsome workaround ;) </a>"

echo "</html>"
echo "#!/bin/bash" >/tmp/tmp.$$.sh
echo kill $CT_PID >>/tmp/tmp.$$.sh
echo 'rm -f $0' >>/tmp/tmp.$$.sh
chmod +x /tmp/tmp.$$.sh

